{% args info,controllers %}
<script type="text/javascript">
    function controllerDelete(id) {
        $.ajax({
            url: "/api/v1.0/controller/" + id,
            type: 'DELETE',
            success: function(product) {
                $(ctl).parents("tr").remove();
            },
            error: function(request, message, error) {
                handleException(request, message, error);
            }
        });
        setTimeout("location.href = '/controllers'", 3000); // milliseconds, so 3 seconds = 3000ms
    }
</script>
<table cellpadding='4' border='1' frame='box' rules='all'>
    <TH>
        <TH>ID
            <TH>Protocol
                <TH>Hostname
                    <TH>Port
                        <TH>Enabled
                            <TH>
                                {% for controller in controllers %} {% if controller['id'] != 0 %}
                                <TR>
                                    <TD><a class="button link" href="/controller_setting?id={{controller['id']}}">Edit</a>
                                        <TD>{{controller['id']}}
                                            <TD>{{controller['protocol']}}
                                                <TD>{{controller['hostname']}}
                                                    <TD>{{controller['port']}}
                                                        <TD><span style="color:{% if controller['enable']=='on' %}green{% else %}red{% endif %}">{% if controller['enable']=='on' %}Yes{% else %}No{% endif %}</span>
                                                            <TD><a class="button link" onclick="controllerDelete({{controller['id']}});">Del</a> {% endif %} {% endfor %}
                                                                <TR>
                                                                    <TD><a class="button link" href="/controller_setting?id=0">Add</a>
                                                                        <TD colspan="5">
</table>